if 5<2:
    print("111")
else:
    print("222")


#a   b   c   三个数字比较大小
#嵌套





#elif  多重if
#  *
# ***
# *****
# ***
#  *
hang = int(input("请输入行数："))
for i in range(1, 2 * ((hang - 1) // 2 + 1), 2):
    print(('*' * i).center(hang))
for i in range(2 * ((hang - 1) // 2) - 1, 0, -2):
    print(('*' * i).center(hang))
# 写一个九九乘法表
for i in range(1, 10):
    for j in range(1, i + 1):
        print("%d * %d = %d" % (j, i, i * j), end="\t")
    print()

# 打印水仙花数
for i in range(100, 1000):
    a = i % 10
    b = i // 10 % 10
    c = i // 100
    if a ** 3 + b ** 3 + c ** 3 == i:
        print(i)

# 完数
a = int(input("请输入要打印的完数的范围："))
perfect_numbers = []
for num2 in range(1, a + 1):
    if num2 == sum(i for i in range(1, num2) if num2 % i == 0):
        perfect_numbers.append(num2)
print(perfect_numbers)
# 质数
m = int(input("请输入要打印的质数的范围："))
primes = []
for num1 in range(2, m + 1):
    is_prime = True
    for i in range(2, int(num1 ** 0.5) + 1):
        if num1 % i == 0:
            is_prime = False
            break
    if is_prime:
        primes.append(num1)
print(primes)
# 斐波那契数列
n = int(input("请输入斐波那契数列的位数："))
fib_sequence = [0, 1]
while len(fib_sequence) < n:
    fib_sequence.append(fib_sequence[-1] + fib_sequence[-2])
print(fib_sequence[:n])